package cn.teawooo.tree.mvnpro.project;

/**
 * 功能描述：
 * @author teawooo <long1795@gmail.com>
 * @time 2013年8月26日 下午2:50:35
 */
public class MvnModule {

    private String groupId;
    private String artifactId;
    private String name;
    private String description;
    private PackagingType packaging = PackagingType.jar;
    private String version;

    public MvnModule() {
    }

    public MvnModule(String groupIdAndArtifactId) {
        this(groupIdAndArtifactId.lastIndexOf(".") < 0 ? groupIdAndArtifactId : groupIdAndArtifactId.substring(0,
                groupIdAndArtifactId.lastIndexOf(".")), groupIdAndArtifactId.substring(groupIdAndArtifactId
                .lastIndexOf(".") + 1));
    }

    public MvnModule(String groupId, String artifactId) {
        this(PackagingType.jar, groupId, artifactId);
    }

    public MvnModule(PackagingType pt, String groupId, String artifactId) {
        this.packaging = pt;
        this.groupId = groupId;
        this.artifactId = artifactId;
        this.name = artifactId;//---
    }

    public String getGroupId() {
        return groupId;
    }

    public void setGroupId(String groupId) {
        this.groupId = groupId;
    }

    public String getArtifactId() {
        return artifactId;
    }

    public void setArtifactId(String artifactId) {
        this.artifactId = artifactId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public PackagingType getPackaging() {
        return packaging;
    }

    public void setPackaging(PackagingType packaging) {
        this.packaging = packaging;
    }

    public String getVersion() {
        return version;
    }

    public void setVersion(String version) {
        this.version = version;
    }
}
